home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / Oberon⁄F™ 1.2 / Preinstalled version / System / Docu / Containers (.txt) < prev    next >
Encoding:
Oberon Document  |  1996-07-08  |  36.7 KB  |  475 lines  |  [oODC/obnF]

  1. Documents.StdDocumentDesc
  2. Documents.DocumentDesc
  3. Containers.ViewDesc
  4. Views.ViewDesc
  5. Stores.StoreDesc
  6. Documents.ModelDesc
  7. Containers.ModelDesc
  8. Models.ModelDesc
  9. Stores.ElemDesc
  10. TextViews.StdViewDesc
  11. TextViews.ViewDesc
  12. TextModels.StdModelDesc
  13. TextModels.ModelDesc
  14. TextModels.AttributesDesc
  15. Helvetica
  16. TextRulers.StdRulerDesc
  17. TextRulers.RulerDesc
  18. TextRulers.StdStyleDesc
  19. TextRulers.StyleDesc
  20. TextRulers.AttributesDesc
  21. Helvetica
  22. Helvetica
  23. Helvetica
  24. StdLinks.LinkDesc
  25. StdCmds.OpenBrowser('Form/Map', 'Map to Form Subsystem')
  26. Helvetica
  27. Helvetica
  28. Helvetica
  29. name    code    meaning
  30. aL    1CX    arrow left
  31. aR    1DX    arrow right
  32. aU    1EX    arrow up
  33. aD    1FX    arrow down
  34. pL    10X    page left
  35. pR    11X    page right
  36. pU    12X    page up
  37. pD    13X    page down
  38. dL    14X    document left
  39. dR    15X    document right
  40. dU    16X    document up
  41. dD    17X    document down
  42. TextControllers.StdCtrlDesc
  43. TextControllers.ControllerDesc
  44. Containers.ControllerDesc
  45. Controllers.ControllerDesc
  46. Arial
  47. Helvetica
  48. Helvetica
  49. name    code    meaning
  50. enter    3X    enter
  51. rdel    7X    right delete
  52. del    8X    left delete
  53. tab    09X    tabulator
  54. ltab    0AX    reverse tabulator
  55. line    0DX    line
  56. para    0EX    paragraph
  57. esc    1BX    escape
  58. Arial
  59. Containers
  60. DEFINITION Containers;
  61.     IMPORT Controllers, Stores, Views, Models, Properties;
  62.     CONST
  63.         noSelection = 0; noFocus = 1; noCaret = 2;
  64.         mask = {noSelection, noCaret}; layout = {noFocus};
  65.         deselect = FALSE; select = TRUE;
  66.         any = FALSE; selection = TRUE;
  67.         hide = FALSE; show = TRUE;
  68.     TYPE
  69.         LONGCHAR = INTEGER;
  70.         Model = POINTER TO ModelDesc;
  71.         ModelDesc = RECORD (Models.ModelDesc)
  72.             PROCEDURE (m: Model) GetEmbeddingLimits
  73.                                                                         (VAR minW, maxW, minH, maxH: LONGINT);
  74.             PROCEDURE (m: Model) ReplaceView (old, new: Views.View)
  75.         END;
  76.         View = POINTER TO ViewDesc;
  77.         ViewDesc = RECORD (Views.ViewDesc)
  78.             PROCEDURE (v: View) InitModel (m: Model);
  79.             PROCEDURE (v: View) ThisModel (): Model;
  80.             PROCEDURE (v: View) SetController (c: Controller);
  81.             PROCEDURE (v: View) ThisController (): Controller;
  82.             PROCEDURE (v: View) GetRect (f: Views.Frame; view: Views.View;
  83.                                                                         VAR l, t, r, b: LONGINT);
  84.             PROCEDURE (v: View) CatchModelMsg (VAR msg: Models.Message);
  85.             PROCEDURE (v: View) CatchViewMsg (f: Views.Frame; VAR msg: Views.Message);
  86.             PROCEDURE (v: View) CatchCtrlMsg (f: Views.Frame; VAR msg: Views.CtrlMessage;
  87.                                                                         VAR focus: Views.View);
  88.             PROCEDURE (v: View) CatchPropMsg (VAR p: Views.PropMessage)
  89.         END;
  90.         Controller = POINTER TO ControllerDesc;
  91.         ControllerDesc = RECORD (Controllers.ControllerDesc)
  92.             opts-: SET;
  93.             PROCEDURE (c: Controller) ThisView (): View;
  94.             PROCEDURE (c: Controller) SetOpts (opts: SET);
  95.             PROCEDURE (c: Controller) GetContextType (VAR type: Stores.TypeName);
  96.             PROCEDURE (c: Controller) GetValidOps (VAR valid: SET);
  97.             PROCEDURE (c: Controller) NativeModel (m: Models.Model): BOOLEAN;
  98.             PROCEDURE (c: Controller) NativeView (v: Views.View): BOOLEAN;
  99.             PROCEDURE (c: Controller) NativeCursorAt (f: Views.Frame;
  100.                                                                                     x, y: LONGINT): INTEGER;
  101.             PROCEDURE (c: Controller) PickNativeProp (f: Views.Frame; x, y: LONGINT;
  102.                                                                                     VAR p: Properties.Property);
  103.             PROCEDURE (c: Controller) PollNativeProp (selection: BOOLEAN;
  104.                                                         VAR p: Properties.Property; VAR truncated: BOOLEAN);
  105.             PROCEDURE (c: Controller) SetNativeProp (selection: BOOLEAN;
  106.                                                                                     old, p: Properties.Property);
  107.             PROCEDURE (c: Controller) GetFirstView (selection: BOOLEAN; VAR v: Views.View);
  108.             PROCEDURE (c: Controller) GetNextView (selection: BOOLEAN; VAR v: Views.View);
  109.             PROCEDURE (c: Controller) GetPrevView (selection: BOOLEAN; VAR v: Views.View);
  110.             PROCEDURE (c: Controller) CanDrop (f: Views.Frame; x, y: LONGINT): BOOLEAN;
  111.             PROCEDURE (c: Controller) MarkDropTarget (src, dst: Views.Frame;
  112.                                                                                     sx, sy, dx, dy, w, h, rx, ry: LONGINT;
  113.                                                                                     type: Stores.TypeName;
  114.                                                                                     isSingle, show: BOOLEAN);
  115.             PROCEDURE (c: Controller) Drop (src, dst: Views.Frame;
  116.                                                                             sx, sy, dx, dy, w, h, rx, ry: LONGINT;
  117.                                                                             view: Views.View; isSingle: BOOLEAN);
  118.             PROCEDURE (c: Controller) MarkPickTarget (src, dst: Views.Frame;
  119.                                                                     sx, sy, dx, dy: LONGINT; show: BOOLEAN);
  120.             PROCEDURE (c: Controller) TrackMarks (f: Views.Frame; x, y: LONGINT
  121.                                                                              units, extend, add: BOOLEAN);
  122.             PROCEDURE (c: Controller) Resize (view: Views.View; l, t, r, b: LONGINT);
  123.             PROCEDURE (c: Controller) GetSelectionBounds (f: Views.Frame;
  124.                                                                                                     VAR x, y, w, h: LONGINT);
  125.             PROCEDURE (c: Controller) DeleteSelection;
  126.             PROCEDURE (c: Controller) MoveLocalSelection (src, dst: Views.Frame;
  127.                                                                                             sx, sy, dx, dy: LONGINT);
  128.             PROCEDURE (c: Controller) CopyLocalSelection (src, dst: Views.Frame;
  129.                                                                                             sx, sy, dx, dy: LONGINT);
  130.             PROCEDURE (c: Controller) SelectionCopy (): Model;
  131.             PROCEDURE (c: Controller) NativePaste (m: Models.Model; f: Views.Frame);
  132.             PROCEDURE (c: Controller) ArrowChar (f: Views.Frame; ch: CHAR;
  133.                                                                                 units, select: BOOLEAN);
  134.             PROCEDURE (c: Controller) ControlChar (f: Views.Frame; ch: CHAR);
  135.             PROCEDURE (c: Controller) PasteChar (ch: CHAR);
  136.             PROCEDURE (c: Controller) PasteLChar (ch: INTEGER);
  137.             PROCEDURE (c: Controller) PasteView (f: Views.Frame; v: Views.View;
  138.                                                                             w, h: LONGINT);
  139.             PROCEDURE (c: Controller) HasSelection (): BOOLEAN;
  140.             PROCEDURE (c: Controller) Selectable (): BOOLEAN;
  141.             PROCEDURE (c: Controller) Singleton (): Views.View;
  142.             PROCEDURE (c: Controller) SetSingleton (s: Views.View);
  143.             PROCEDURE (c: Controller) SelectAll (select: BOOLEAN);
  144.             PROCEDURE (c: Controller) InSelection (f: Views.Frame; x, y: LONGINT): BOOLEAN;
  145.             PROCEDURE (c: Controller) MarkSelection (f: Views.Frame; show: BOOLEAN);
  146.             PROCEDURE (c: Controller) SetFocus (focus: Views.View);
  147.             PROCEDURE (c: Controller) HasCaret (): BOOLEAN;
  148.             PROCEDURE (c: Controller) MarkCaret (f: Views.Frame; show: BOOLEAN);
  149.             PROCEDURE (c: Controller) Mark (f: Views.Frame;
  150.                                                                     l, t, r, b: LONGINT; show: BOOLEAN)
  151.         END;
  152.         Directory = POINTER TO DirectoryDesc;
  153.         DirectoryDesc = RECORD 
  154.             PROCEDURE (d: Directory) New (): Controller;
  155.             PROCEDURE (d: Directory) NewController (opts: SET): Controller
  156.         END;
  157.     PROCEDURE  FadeMarks (c: Controller; show: BOOLEAN);
  158.     PROCEDURE  Focus (): Controller;
  159.     PROCEDURE  FocusSingleton (): Views.View;
  160.     PROCEDURE  MarkSingleton (c: Controller; f: Views.Frame; show: BOOLEAN);
  161. END Containers.
  162. Containers are views which may contain other (embedded) views. Typically, containers belong to one of two categories. The first category contains containers with a fixed structure and fixed types of the embedded views. For example, an e-mail container view may consist of exactly two views: a toolbar view at the top, and a text view below. The layout of these views typically cannot be edited. Such views are called static containers.
  163. The second category of containers can embed arbitrary numbers of views, which can be of arbitrary types. Text views and form views are typical examples of such dynamic container views. Only this second category of container views, called dynamic containers, is supported by module Containers, and it is the topic of this text.
  164. Dynamic containers consist of a variable number of embedded views, plus some intrinsic contents. Text views for example have text as their intrinsic contents, but also allow to let arbitrary views (i.e. non-intrinsic contents) flow along in the text. Form views are degenerated in the sense that they provide no intrinsic contents of their own.
  165. Different compound document standards (OLE, OpenDoc) differ in the way they treat selections and the focus. The focus is the currently edited view, the view which receives keyboard events, the view which determines the currently available menus, the view which contains the currently relevant selection, caret, or other mark.
  166. Containers provides the building blocks for container views, including special container models and container controllers. Other than most Oberon/F modules, Containers exports several partially implemented types, rather than pure interface types. What is implemented is provided in a form suitable for the used platform, i.e. user interface differences are hidden by the implementation of Containers.
  167. In particular, Containers fully implements singleton selections, i.e. selections which cover exactly one view and no intrinsic contents. Such selections are subject to special operations and require platform-dependent treatment. Also, Containers implements the focus concept: a single embedded view within a controller's model that is picked by the user as current focus.
  168. Example: 
  169. subsystem
  170. CONST noSelection, noFocus, noCaret
  171. Possible elements of Controller.opt. noSelection denotes that selections should be switched off, noFocus denotes that no embedded view should be allowed to become focus, and noCaret denotes that the caret (insertion mark) and thus the possibility to type or paste should be switched off.
  172. CONST mask, layout
  173. Two particularly useful subsets of Controller.opt. A mask prevents editing of the container's intrinsic contents, but enables focusing and thereby editing of the contained objects; for example, this allows to use a form without changing the form itself. A layout does just the opposite: focusing and therefore editing of contained objects is inhibited, but the container's intrinsic contents may be freely edited; for example, this is useful when editing a form without wanting to actually activate, say, a button, while editing its position in the form.
  174. CONST deselect, select
  175. Possible values of the select parameter of Controller.SelectAll.
  176. CONST any, selection
  177. Possible values of the selection parameters of Controller.GetFirstView, Controller.GetNextView, Controller.GetPrevView, Controller.PollNativeProp, and Controller.SetNativeProp. Controls whether the range of the operation is the current selection or the whole container contents.
  178. CONST hide, show
  179. Possible values of the show parameter of FadeMarks, MarkSingleton, Controller.Mark, Controller.MarkCaret, Controller.MarkDropTarget, Controller.MarkPickTarget, and Controller.MarkSelections. Controls whether the respective mark is to be hidden or shown.
  180. TYPE LONGCHAR = INTEGER
  181. Type of long characters.
  182. TYPE Model
  183. Interface, Extension
  184. Models for containers.
  185. PROCEDURE (m: Model) GetEmbeddingLimits (VAR minW, maxW, minH, maxH: LONGINT)
  186. Interface
  187. Return minimum (minW, minH) and maximum (maxW, maxH) bounds on view sizes to be embedded in model m. If it is tried to embed a view into m with width < minW, width >= maxW, height < minH, or height >= maxH, then m should (but is not absolutely required to) modify the size of the embedded view in order to make it fit.
  188. 0 <= minW <= maxW
  189. 0 <= minH <= maxH
  190. PROCEDURE (m: Model) ReplaceView (old, new: Views.View)
  191. Interface
  192. In-place substitution of view old which must be embedded in m by view new which must not yet be embedded anywhere. As a result, new gets embedded in m, but old retains its context which it then shares with new. Replacing a view in
  193. place allows wrapping of views: A new view takes place of an existing one, adds some new properties, but still can hold a reference to the old view and delegate requests to the old view. Since the old view has maintained its context, it will continue to function as if it where directly embedded in m.
  194. old # NIL
  195. old.context.ThisModel() = m
  196. EmbeddedIn(old, m)
  197. new # NIL
  198. new.context = NIL
  199. NotEmbedded(old)
  200. new.context.ThisModel() = m
  201. new.context = old.context
  202. TYPE View
  203. Interface, Extension
  204. Views for containers.
  205. PROCEDURE (v: View) Internalize (VAR rd: Stores.Reader)
  206. Base, Extension
  207. Fully implements internalization for views without intrinsic persistent state by handling internalization of the container view's model and controller. If the model internalization fails, the view is turned into an alien and internalization of v is cancelled; otherwise the model is attached to v. If the controller internalization fails, the controller is kept for later externalization to prevent loss of information, but is otherwise not connected to the view (v.ThisController() = NIL), and the view is internalized normally (i.e. not turned into an alien).
  208. PROCEDURE (v: View) Externalize (VAR wr: Stores.Writer)
  209. Base, Extension
  210. Fully implements externalization for views without intrinsic persistent state by handling externalization of the container view's model and controller. If v has been internalized before with an alien controller, and no other controller has been installed thereafter, then the alien controller will be externalized, although v.ThisController() = NIL.
  211. v.ThisModel() # NIL    20
  212. PROCEDURE (v: View) CopyFrom (source: Views.View)
  213. Assuming that the model of v has already been established, copy the controller and possibly other view state from source. If source holds a hidden alien controller (cf. Internalize above), a reference to it is also copied.
  214. v.ThisModel() # NIL    20
  215. source.ThisController() = NIL
  216.     v.ThisController() = NIL
  217. source.ThisController() # NIL
  218.     v.ThisController() = source.ThisController().Clone().CopyFrom(source.ThisController())
  219. PROCEDURE (v: View) ThisModel (): Model
  220. Return the model of v.
  221. PROCEDURE (v: View) SetController (c: Controller)
  222. Base, Operation
  223. Set the controller of v. If v holds a hidden alien controller, it is removed.
  224. v.ThisModel() # NIL    20
  225. v.ThisController() = c
  226. PROCEDURE (v: View) ThisController (): Controller
  227. Return the controller of v.
  228. PROCEDURE (v: View) GetRect (f: Views.Frame; view: Views.View; VAR l, t, r, b: LONGINT)
  229. Interface
  230. For display in frame f, determine the bounding box of view which must be a view contained in v. Should the computation of the bounding box be too expensive, returning an approximation is acceptable.
  231. l <= r
  232. t<= b
  233. PROCEDURE (v: View) RestoreMarks (f: Views.Frame; l, t, r, b: LONGINT)
  234. Default, Extension
  235. If v has a controller installed, then the default is to delegate to the controller, i.e. to call v.ThisController().RestoreMarks(f, l, t, r, b). Otherwise nothing is done by default.
  236. PROCEDURE (v: View) Neutralize
  237. Default, Extension
  238. If v has a controller installed, then the default is to delegate to the controller, i.e. to call v.ThisController().Neutralize. Otherwise nothing is done by default.
  239. PROCEDURE (v: View) ConsiderFocusRequestBy (view: Views.View)
  240. Default, Extension
  241. If v has a controller installed, then the default is to delegate to the controller, i.e. to call v.ThisController().ConsiderFocusRequestBy(view). Otherwise nothing is done by default.
  242. PROCEDURE (v: View) CatchModelMsg (VAR msg: Models.Message)
  243. Default
  244. Nothing is done by default. Refer to View.HandleModelMsg below.
  245. PROCEDURE (v: View) CatchViewMsg (f: Views.Frame; VAR msg: Views.Message)
  246. Default
  247. Nothing is done by default. Refer to View.HandleViewMsg below.
  248. PROCEDURE (v: View) CatchCtrlMsg
  249.     (f: Views.Frame; VAR msg: Controllers.Message; VAR focus: Views.View)
  250. Default
  251. Nothing is done by default. Refer to View.HandleCtrlMsg below.
  252. PROCEDURE (v: View) CatchPropMsg (VAR p: Properties.Message)
  253. Default
  254. Nothing is done by default. Refer to View.HandlePropMsg below.
  255. PROCEDURE (v: View) HandleModelMsg (VAR msg: Models.Message)
  256. Default, Extension
  257. First calls v.CatchModelMsg(msg), then, if v has a controller installed, calls v.ThisController().HandleModelMsg(msg). That is, the view sees the model message msg before its controller does.
  258. PROCEDURE (v: View) HandleViewMsg (f: Views.Frame; VAR msg: Views.Message)
  259. Default, Extension
  260. First calls v.CatchViewMsg(msg), then, if v has a controller installed, calls v.ThisController().HandleViewMsg(msg). That is, the view sees the view message msg before its controller does.
  261. PROCEDURE (v: View) HandleCtrlMsg (f: Views.Frame;
  262.     VAR msg: Controllers.Message; VAR focus: Views.View)
  263. Default, Extension
  264. If v has a controller installed, calls v.ThisController().HandleCtrlMsg(f, msg, focus), then calls v.CatchCtrlMsg(f, msg, focus). That is, the controller sees the controller message msg before the view does.
  265.     Additionally, a strict filter is applied to throw away unwanted messages: Messages are only delegated to the controller or view if they fulfill one of the following three criteria:
  266. First, the frame f is a target or front frame. Second, the message is derived from Controllers.PollOpsMsg, Controllers.PollCursorMsg, Controllers.TransferMessage, or Controllers.PageMsg. Third, the context of v is normalizing, i.e. v.context.Normalize() holds, and the message is derived from Controllers.PollSectionMsg or Controllers.ScrollMsg. This is a standard message filtering condition making components more robust against spurious message sends.
  267.     Finally, scrolling messages (derived from Controllers.PollSectionMsg or Controllers.ScrollMsg) may ask for shallow handling (~msg.focus), i.e. supression of forwarding to a possibly existing subfocus. This is generically handled by clearing focus on return in these cases.
  268. (msg IS Controllers.PollSectionMsg) OR (msg IS Controllers.ScrollMsg)
  269.     ~msg.focus
  270.         focus = NIL
  271. PROCEDURE (v: View) HandlePropMsg (VAR p: Properties.Message)
  272. Default, Extension
  273. First calls v.CatchPropMsg(p), then, if v has a controller installed, calls v.ThisController().HandlePropMsg(p). That is, the view sees the property message p before its controller does.
  274. TYPE Controller
  275. Interface, Extension
  276. Controllers for containers.
  277. opts-: SET
  278. Option set of controller; used to restrict controller functionality to defined subsets.
  279. PROCEDURE (c: Controller) ThisView (): View
  280. Return type is narrowed.
  281. PROCEDURE (c: Controller) SetOpts (opts: SET)
  282. Base, Operation
  283. Set the options of c. This is only an operation after a view has been installed, i.e. c.ThisView() # NIL, otherwise it is a simple assignment of opts to c.opts. Options 0..7 are used or reserved by Oberon/F, the rest may be used by extensions.
  284. c.opts = opts
  285. PROCEDURE (c: Controller) GetContextType (VAR type: Stores.TypeName)
  286. Interface
  287. Called by c.HandleCtrlMsg below to fill in Controllers.PollOpsMsg.type.
  288. PROCEDURE (c: Controller) GetValidOps (VAR valid: SET)
  289. Interface
  290. Called by c.HandleCtrlMsg below to fill in Controllers.PollOpsMsg.ops.
  291. PROCEDURE (c: Controller) NativeModel (m: Models.Model): BOOLEAN
  292. Interface
  293. Check whether m is a native model of c, i.e. a model that could be attached to a view attachable to c.
  294. PROCEDURE (c: Controller) NativeView (v: Views.View): BOOLEAN
  295. Interface
  296. Check whether v is a native view of c, i.e. a view that could be attached to c.
  297. PROCEDURE (c: Controller) NativeCursorAt (f: Views.Frame; x, y: LONGINT): INTEGER
  298. Interface
  299. The cursor that c would display in f at point (x, y), irrespective of possible embedded views at that position.
  300. PROCEDURE (c: Controller) PickNativeProp (f: Views.Frame; x, y: LONGINT;
  301.     VAR p: Properties.Property)
  302. Interface
  303. The properties of c's native contents in f at point (x, y), irrespective of possible embedded views at that position.
  304. PROCEDURE (c: Controller) PollNativeProp (selection: BOOLEAN;
  305.     VAR p: Properties.Property; VAR truncated: BOOLEAN);
  306. Interface
  307. The properties of c's native selected or whole contents, irrespective of possible embedded views in that range.
  308. PROCEDURE (c: Controller) SetNativeProp (selection: BOOLEAN; old, p: Properties.Property)
  309. Interface
  310. Set the properties of c's native selected or whole contents to p, irrespective of possible embedded views in that range. For properties also in old change only those property values of c that match the ones given in old. This allows for masked modification of properties. For example, in a colored model, all red objects could be changed to become green.
  311. PROCEDURE (c: Controller) GetFirstView (selection: BOOLEAN; VAR v: Views.View)
  312. Interface
  313. Get the first view embedded in c's model, relative to the model's start or that of a possible selection.
  314. PROCEDURE (c: Controller) GetNextView (selection: BOOLEAN; VAR v: Views.View)
  315. Interface
  316. Get the next view in the specified range, which is either the selected or the whole contents of c's model. The next view of the last view in the range is NIL.
  317. PROCEDURE (c: Controller) GetPrevView (selection: BOOLEAN; VAR v: Views.View)
  318. Default
  319. Get the previous view in the specified range, which is either the selected or the whole contents of c's model. The default uses GetFirstView and GetNextView to seek the previous view of v. The previous view of the first view in the range is NIL.
  320. v # NIL    20
  321. EmbeddedIn(v, c.ThisModel())    21
  322. PROCEDURE (c: Controller) CanDrop (f: Views.Frame; x, y: LONGINT): BOOLEAN
  323. Default
  324. Return whether the material being dragged could be dropped into frame f at its local coordinate (x, y). The default is to accept any drop request, i.e. to return TRUE.
  325. PROCEDURE (c: Controller) MarkDropTarget (src, dst: Views.Frame;
  326.                                                                                     sx, sy, dx, dy, w, h, rx, ry: LONGINT;
  327.                                                                                     type: Stores.TypeName;
  328.                                                                                     isSingle, show: BOOLEAN)
  329. Default
  330. Mark the drop target in destination frame dst at point (dx, dy) for a potential dropping of material from source frame src, origin (sx, sy). show determines whether the mark should be drawn or removed. isSingle determines whether the selection to be dropped is a singleton.
  331. PROCEDURE (c: Controller) Drop (src, dst: Views.Frame; sx, sy, dx, dy, w, h, rx, ry: LONGINT;
  332.                                                                 view: Views.View; isSingle: BOOLEAN)
  333. Default
  334. Drop the material being dragged from source frame src, origin (sx, sy) and encapsulated in view under control of c in destination frame dst at point (dx, dy). The default is to ignore the drop. isSingle determines whether the selection to be dropped is a singleton.
  335. PROCEDURE (c: Controller) MarkPickTarget (src, dst: Views.Frame; sx, sy, dx, dy: LONGINT; show: BOOLEAN)
  336. Default
  337. Mark the drop target in destination frame dst at point (dx, dy) for a potential dropping of material from source frame src, origin (sx, sy). show determines whether the mark should be drawn or removed. The default is not to mark at all.
  338. PROCEDURE (c: Controller) TrackMarks (f: Views.Frame; x, y: LONGINT; units, extend, add: BOOLEAN)
  339. Interface
  340. Track marks in frame f starting at point (x, y) as specified by units, extend, and add. Marks are general selections and insertion points (carets). Tracking of larger logical units (e.g. words instead of characters) is requested by units. Continuous extension of an existing selection is requested by extend. Discontinuous addition to an existing selection is requested by add.
  341.     Some controllers may ignore one or the other request, e.g. may not distinguish units of varying granularity, may not support multiple selected objects, or may not support discontinuous selections.
  342. PROCEDURE (c: Controller) Resize (view: Views.View; l, t, r, b: LONGINT)
  343. Interface
  344. Request to resize view, which must be embedded in c's model, to the size given by rectangle (l, t, r, b).
  345.     (Typically, a controller delegates this request to its model which implements the request by using Properties.PreferredSize to negotiate the new size with view.)
  346. PROCEDURE (c: Controller) GetSelectionBounds (f: Views.Frame;
  347.                                                                                             VAR x, y, w, h: LONGINT)
  348. Interface
  349. Return the bounding box of the selection, by giving its top-left reference point and its width and height. The bounding box is used for giving drag & drop feedback.
  350. PROCEDURE (c: Controller) DeleteSelection
  351. Interface
  352. Delete all objects in the current selection.
  353. PROCEDURE (c: Controller) MoveLocalSelection (src, dst: Views.Frame;
  354.                                                                                             sx, sy, dx, dy: LONGINT)
  355. Interface
  356. Move selected objects within the model of c from the origin given by source frame src and point (sx, sy) to the target given by destination frame dst and point (dx, dy). Since this is a move of material within a single model, there is no need for conversions, and the most "natural" moving semantics can be provided.
  357. PROCEDURE (c: Controller) CopyLocalSelection (src, dst: Views.Frame;
  358.                                                                                             sx, sy, dx, dy: LONGINT)
  359. Interface
  360. Copy selected objects within the model of c from the origin given by source frame src and point (sx, sy) to the target given by destination frame dst and point (dx, dy). Since this is a copy of material within a single model, there is no need for conversions, and the most "natural" copying semantics can be provided.
  361. PROCEDURE (c: Controller) SelectionCopy (): Model
  362. Interface
  363. Return a copy of the selected objects, encapsulated in the returned model.
  364. PROCEDURE (c: Controller) NativePaste (m: Models.Model; f: Views.Frame)
  365. Interface
  366. Paste a native model into the model of c as displayed in frame f. Since the model is native, it is to be merged into the model of c rather than wrapped into a view and embedded.
  367. PROCEDURE (c: Controller) ArrowChar (f: Views.Frame; ch: CHAR; units, select: BOOLEAN)
  368. Interface
  369. Interpret the arrow character ch, i.e. one out of the following list. The interpretation is to be modified as requested by units and select. The standard interpretation of arrow characters is the modification of the current selection or the moving of the insertion point. Modifying or moving in larger units (e.g. words instead of characters) is requested by units. Establishment of a selection if requested by select.
  370.     Some controllers may ignore one or the other request, e.g. may not distinguish units of varying granularity or may not support selections.
  371. Table of arrow characters:
  372. The intention is a modification or move in the indicated direction on the smallest supported granularity ("arrow"), on the basis of "pages" as defined by the size of frame f, or on the basis of the whole "document", i.e. the far extremes of the model of c. The precise interpretation of the directions and units is left to the specific controller.
  373. PROCEDURE (c: Controller) ControlChar (f: Views.Frame; ch: CHAR)
  374. Interface
  375. Handle entry of control character ch related to the model and view of c as displayed in frame f.
  376. Table of control characters:
  377. PROCEDURE (c: Controller) PasteChar (ch: CHAR)
  378. Interface
  379. Paste character ch into the model of c.
  380. PROCEDURE (c: Controller) PasteLChar (ch: LONGCHAR)
  381. Interface
  382. Paste long character ch into the model of c.
  383. PROCEDURE (c: Controller) PasteView (f: Views.Frame; v: Views.View; w, h: LONGINT)
  384. Interface
  385. Paste view v with desired size (w, h) into the model of c.
  386.     (Typically, a controller delegates this request to its model which implements the request by using Properties.PreferredSize to negotiate the new size with v.)
  387. PROCEDURE (c: Controller) HasSelection (): BOOLEAN
  388. Return whether the controller currently has a selection. By default, only singleton selections are supported. To be extended to include intrinsic selections.
  389. c.ThisModel() # NIL    20
  390. PROCEDURE (c: Controller) Selectable (): BOOLEAN
  391. Interface
  392. Return whether the controller could establish a non
  393. empty selection. If something (or everything) is already selected, this is considered selectable.
  394. PROCEDURE (c: Controller) Singleton (): Views.View
  395. If the controller currently has a singleton selection, then the selected view is returned, else NIL.
  396. PROCEDURE (c: Controller) SetSingleton (s: Views.View)
  397. Set the controller's selection to a singleton selection covering view s. IF s = NIL, the current singleton selection is cleared. Needs to be extended to adjust intrinsic selection state accordingly.
  398. c.ThisModel() # NIL    20
  399. ~(noSelection IN c.opts)    21
  400. s # NIL
  401.     s.context # NIL    22
  402.     s.context.ThisModel() = c.ThisModel()    23
  403. c.Singleton() = s
  404. PROCEDURE (c: Controller) SelectAll (select: BOOLEAN)
  405. Interface
  406. Set the selection to its maximum extent, i.e. select all intrinsic content of the controller's model plus all embedded views. For an empty model there is no visible result; for a model with only one embedded view and no intrinsic contents a singleton selection results.
  407. PROCEDURE (c: Controller) InSelection (f: Views.Frame; x, y: LONGINT): BOOLEAN
  408. Interface
  409. Test whether in frame f the point (x, y) lies within the current selection.
  410. PROCEDURE (c: Controller) MarkSelection (f: Views.Frame; show: BOOLEAN)
  411. Default
  412. Depending on show, show or hide the selection's visual marking. The default handles singleton selections only. To be replaced to include intrinsic selections.
  413. PROCEDURE (c: Controller) ThisFocus (): Views.View
  414. Returns the current subfocus.
  415. c.ThisModel() # NIL    20
  416. PROCEDURE (c: Controller) SetFocus (focus: Views.View)
  417. Sets the current subfocus to focus; if focus = NIL, the current subfocus is removed.
  418. c.ThisModel() # NIL    20
  419. focus # NIL
  420.     focus.context # NIL    21
  421.     focus.context.ThisModel() = c.ThisModel()    22
  422. c.ThisFocus() = focus
  423. PROCEDURE (c: Controller) ConsiderFocusRequestBy (view: Views.View)
  424. Default
  425. If c has no current focus, then set it to view.
  426. c.ThisModel() # NIL    20
  427. view # NIL    21
  428. view.context # NIL    22
  429. view.context.ThisModel() = c.ThisModel()        23
  430. c'.ThisFocus() = NIL
  431.     c.ThisFocus() = view
  432. PROCEDURE (c: Controller) HasCaret (): BOOLEAN
  433. Interface
  434. Return whether the controller has a valid caret (insertion point).
  435. PROCEDURE (c: Controller) MarkCaret (f: Views.Frame; show: BOOLEAN)
  436. Interface
  437. Depending on show, show or hide the current caret's visual marking.
  438. PROCEDURE (c: Controller) Mark (f: Views.Frame; l, t, r, b: LONGINT; show: BOOLEAN)
  439. Except for performance, equivalent to:
  440.     MarkFocus(c, f, show); c.MarkSelection(f, show); c.MarkCaret(f, show)
  441. To be extended to cover additional intinsic marking.
  442. PROCEDURE (c: Controller) RestoreMarks (f: Views.Frame; l, t, r, b: LONGINT)
  443. Default
  444. Calls Mark to show all marks in (l, t, r, b), then, if no subfocus exists and c.opts indicates mask mode, tries to establish a subfocus: the first embedded view that wants to claim the focus (Properties.FocusPref.setFocus) gets it. If the new subfocus wants to start off with an initially selected contents (Properties.FocusPref.selectOnFocus), it is also fully selected.
  445. PROCEDURE (c: Controller) Neutralize
  446. Default
  447. Remove all modal marks, including focus, selection, and caret. The default handles focus and selection. To be extended to handle caret and possibly further marks.
  448. Except for performance, the default is equivalent to:
  449.     c.SetFocus(NIL); c.SelectAll(deselect)
  450. PROCEDURE (c: Controller) HandleModelMsg (VAR msg: Models.Message)
  451. Default
  452. The default is to ignore model messages.
  453. c.ThisModel() # NIL    20
  454. PROCEDURE (c: Controller) HandleViewMsg (f: Views.Frame; VAR msg: Views.Message)
  455. The base case handles Containers interna to maintain markings of focus and singleton selection.
  456. c.ThisModel() # NIL    20
  457. PROCEDURE (c: Controller) HandleCtrlMsg (f: Views.Frame; VAR msg: Controllers.Message;
  458.                             VAR focus: Views.View)
  459. Handles Controllers.PollCursorMsg, Controllers.PollOpsMsg, Controllers.TrackMsg, Controllers.EditMsg, Controllers.TransferMessage, Controllers.SelectMsg, Controllers.MarkMsg, Controllers.ReplaceViewMsg, Properties.CollectMsg, and Properties.EmitMsg.
  460. PROCEDURE (c: Controller) HandlePropMsg (VAR p: Properties.Message)
  461. The default is to handle Properties.SetMsg and Properties.PollMsg by splitting the handling of native and embedded properties and set or return the combined property list. Also, unless noSelection, noFocus, and noCaret are set in c.opts, field Properties.FocusPref.setFocus is set.
  462. c.ThisModel() # NIL    20
  463. TYPE Directory
  464. Interface
  465. Directory for controllers.
  466. PROCEDURE (d: Directory) New (): Controller
  467. Interface
  468. Return new controller with options opts.
  469. PROCEDURE (d: Directory) NewController (opts: SET): Controller
  470. Default
  471. Except for performance, equivalent to:
  472.     RETURN d.New({})
  473. Arial
  474. Documents.ControllerDesc
  475.